import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'



const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  { //
    path: "/cart",
    name: "cart",
    component: () => import("../views/cart/index.vue")
  },
  {
    path: "/mine",
    name: "mine",
    component: () => import("../views/mine/index.vue")
  },
  {
    path: "/cate",
    name: "cate",
    component: () => import("../views/cate/index.vue")
  },
  {
    path: "/product",
    name: "products",
    component: () => import("../views/product/index.vue")
  },
  {
    path: "/live",
    name: "live",
    component: () => import("../views/livehouse/index.vue"),

  },
  {
    path: "/myrou",
    name: "myrou",
    component: () => import("../views/myrouter/index.vue")
  },
  {
    path: "/sign",
    name: "sign",
    component: () => import("../views/signDesgin/index.vue")
  }
]
// createRouter 创建路由对象的方法
// createWebHistory 创建历史模式路由的方法
// createWebHashHistory 创建哈希模式路由的方法
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
